export const CenterNum_Dict = {
  GuiAn: 211,
  JinYang: 201,
  HuaXi: 202,
};

export const Center_TEXT = {
  GuiAn: "贵安数据中心",
  JinYang: "金阳数据中心",
  HuaXi: "花溪数据中心",
};

const DefaultTime = "2024-04-24 12:12:12";

export const myDataRouterList = [
  {
    lrName: "线路1",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "CC-011",
      "CC-031",
      "CC-051",
      "CC-071",
      "CC-081",
      "CC-061",
      "CC-041",
      "CC-021",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路2",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "CC-022",
      "CC-042",
      "CC-062",
      "CC-082",
      "CC-072",
      "CC-052",
      "CC-032",
      "CC-012",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路3",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "A1-216",
      "A1-215",
      "A1-214",
      "A1-213",
      "A1-212",
      "A1-211",
      "A1-210",
      "A1-209",
      "A1-201",
      "A1-202",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路4",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "A1-203",
      "A1-204",
      "A1-205",
      "A1-206",
      "A1-207",
      "A1-208",
      "A1-108",
      "A1-107",
      "A1-115",
      "A1-116",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路5",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "B1-101",
      "B1-102",
      "B1-204",
      "B1-203",
      "B1-202",
      "B1-208",
      "B1-201",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路6",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "B1-304",
      "B1-303",
      "B1-301",
      "B1-402",
      "B1-403",
      "B1-404",
      "B1-405",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路7",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "B2-101",
      "B2-102",
      "B2-204",
      "B2-203",
      "B2-202",
      "B2-201",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路8",
    lrDataCenter: "贵安数据中心",
    lrMachine: [
      "B2-301",
      "B2-302",
      "B2-304",
      "B2-404",
      "B2-403",
      "B2-402",
      "B2-401",
    ],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路9",
    lrDataCenter: Center_TEXT.HuaXi,
    lrMachine: ["2L-C间", "2L-B间", "3L-C间", "3L-B间", "5L-小B间", "5L-大B间"],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
  {
    lrName: "线路10",
    lrDataCenter: Center_TEXT.HuaXi,
    lrMachine: ["5L-C间", "5L-D间", "6L-D间", "6L-C间", "7L-C间", "7L-D间"],
    lrCreater: "系统管理员",
    lrTime: DefaultTime,
  },
];

export const Machine_options = (function () {
  const list = [];

  const lou_list = [
    {
      louVal: "A1",
      louName: "A1栋",
      floor: 2,
      room: 16,
    },
    {
      louVal: "B1",
      louName: "B1栋",
      floor: 4,
      room: 4,
    },
    {
      louVal: "B2",
      louName: "B2栋",
      floor: 4,
      room: 4,
    },
    {
      louVal: "CC",
      louName: "仓储",
      floor: 2,
      room: 8,
    },
  ];

  for (let idx = 0; idx < lou_list.length; idx++) {
    const L_lou = {
      value: lou_list[idx].louVal,
      label: lou_list[idx].louName,
    };
    if (lou_list[idx].floor > 0) {
      L_lou.children = []
      for (let j = 1; j <= lou_list[idx].floor; j++) {
        let louceng = {
          value: `${lou_list[idx].louVal}-${j}`,
          label: `${j}楼`,
        };
        if (lou_list[idx].room > 0) {
          louceng.children = []
          for (let i = 1; i <= lou_list[idx].room; i++) {
            let jifang = {
              value: `${lou_list[idx].louVal}-${j}${i < 10 ? "0" + i : i}`,
              label: `${lou_list[idx].louVal}-${j}${i < 10 ? "0" + i : i}`,
            };
            louceng.children.push(jifang);
          }
        }
        L_lou.children.push(louceng)
      }
    }
    list.push(L_lou)
  }

  return list;
})();
